package com.cyclasoft.projects.ledom.console;

import java.io.File;

import com.cyclasoft.projects.ledom.configuration.LedomConfigurationException;
import com.cyclasoft.projects.ledom.core.Archive;
import com.cyclasoft.projects.ledom.core.ArchiveManager;
import com.cyclasoft.projects.ledom.core.Project;
import com.cyclasoft.projects.ledom.core.DefaultRuntimeEnvironment;
import com.cyclasoft.projects.ledom.core.IExecutor;
import com.cyclasoft.projects.ledom.core.SystemManager;
import com.cyclasoft.projects.ledom.core.Task;

public class ConsoleExecutor implements IExecutor
{
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		try
        {
	        run();
        }
        catch (LedomConfigurationException e)
        {
	        e.printStackTrace();
        }
	}
	
	private static void run() throws LedomConfigurationException
	{
		ArchiveManager man = SystemManager.getInstance().getArchiveManager();
		Archive sys = man.getArchive("system");
		Project project = man.load(new File("src/test/project/console"));
		DefaultRuntimeEnvironment ctx = project.getRuntimeEnvironment("system");
		Task task = sys.getTask();
		ctx.run(task);

	}

}
